#include <iostream>
int main()
{
	int m, n, i, *lpBuffer, p;
	bool bContinue;
	std::cin >> m >> n;
	lpBuffer = new int[m+1];
	for (i = 0; i < m; ++i)
	{
		lpBuffer[i] = i + 1;
	}
	lpBuffer[m] = n + 1;
	bContinue = true;
	while (bContinue)
	{
		for (i = 0; i < m; ++i)
		{
			std::cout << lpBuffer[i] << ' ';
		}
		std::cout << '\n';
		p = 0;
		for (i = m; i > 0; --i)
		{
			if (lpBuffer[i] - lpBuffer[i - 1] > 1)
			{
				p = i;
				break;
			}
		}
		if (p > 0)
		{
			++lpBuffer[p - 1];
			for (i = p; i < m; ++i)
			{
				lpBuffer[i] = lpBuffer[p - 1] + (i - p + 1);
			}
		}
		else
		{
			bContinue = false;
		}
	}
	delete[]lpBuffer;
	return 0;
}
